//
//  ChainNoDataView.m
//  Chain
//
//  Created by zhaosh on 2018/4/3.
//  Copyright © 2018年 zhaosh. All rights reserved.
//
#import "ChainNoDataView.h"

@implementation ChainNoDataView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self = [self initView];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        self = [self initView];
    }
    return self;
}

- (instancetype)initView{
    self.layer.cornerRadius = 2;
    self.layer.masksToBounds= YES;
    self.backgroundColor = AllViewBackgroundColor;
    
    UIImageView *imageVi = [[UIImageView alloc]initWithFrame:CGRectMake((self.width-147)/2, (self.height-200)/2, 147, 137)];
    imageVi.contentMode = UIViewContentModeCenter;
    [imageVi setImage:[UIImage imageNamed:@"zanwu"]];
    [self addSubview:imageVi];
    
    UILabel * lableOne = [[UILabel alloc]initWithFrame:CGRectMake(0, imageVi.bottom+5, self.width, 20)];
    lableOne.text = [NSString stringWithFormat:@"暂无数据"];
    lableOne.textAlignment = NSTextAlignmentCenter;
    lableOne.textColor = [UIColor colorWithHexString:@"#aaa"];
    lableOne.font =[UIFont systemFontOfSize:13.0];
    [self addSubview:lableOne];
    
    self.hidden = YES;
    
    return self;
}
@end
